package com.apestech.framework.xml.plugin.modul;

import com.apestech.framework.json.JSONObject;

/**
 * @author hup
 * @create 2019-02-13-15:48
 */
public class SpecialField {
    public class Field {
        private String timestamp;
        private String createId;
        private String createDate;
        private String updateId;
        private String updateDate;
        private String approveId;
        private String approveDate;
        private String stopId;
        private String stopDate;
        private String operateId;
        private String startDate;
        private String endDate;
        private String conditionId;
        private String state;
        private String version;
        private String billtype;
        private String scene;
        private String memo;

        public void set(JSONObject map){
            this.timestamp=map.getString("timestamp");
            this.createId=map.getString("createId");
            this.createDate=map.getString("createDate");
            this.updateId=map.getString("updateId");
            this.updateDate=map.getString("updateDate");
            this.approveId=map.getString("approveId");
            this.approveDate=map.getString("approveDate");
            this.stopId=map.getString("stopId");
            this.stopDate=map.getString("stopDate");
            this.operateId=map.getString("operateId");
            this.startDate=map.getString("startDate");
            this.endDate=map.getString("endDate");
            this.conditionId=map.getString("conditionId");
            this.state=map.getString("state");
            this.version=map.getString("version");
            this.billtype=map.getString("billtype");
            this.scene=map.getString("scene");
            this.memo=map.getString("memo");
        }

        public String getTimestamp() {
            return timestamp;
        }

        public String getCreateId() {
            return createId;
        }

        public String getCreateDate() {
            return createDate;
        }

        public String getUpdateId() {
            return updateId;
        }

        public String getUpdateDate() {
            return updateDate;
        }

        public String getApproveId() {
            return approveId;
        }

        public String getApproveDate() {
            return approveDate;
        }

        public String getStopId() {
            return stopId;
        }

        public String getStopDate() {
            return stopDate;
        }

        public String getOperateId() {
            return operateId;
        }

        public String getStartDate() {
            return startDate;
        }

        public String getEndDate() {
            return endDate;
        }

        public String getConditionId() {
            return conditionId;
        }

        public String getState() {
            return state;
        }

        public String getVersion() {
            return version;
        }

        public String getBilltype() {
            return billtype;
        }

        public String getScene() {
            return scene;
        }

        public String getMemo() {
            return memo;
        }
    }

    private JSONObject theme=new JSONObject();

    public void addField(String id, JSONObject map){
        Field f=getField(id);
        f.set(map);
        theme.put(id, f);
    }

    public Field getField(String id){
        if(theme.get(id)==null) return new Field();
        else return (Field) theme.get(id);
    }

}
